﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Practices.EnterpriseLibrary.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Model;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;


namespace DAL
{
    public class LoginDAL
    {
        /// <summary>
        /// 链接数据库
        /// </summary>
        Database db = DatabaseFactory.CreateDatabase("constring");
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Pwd"></param>
        /// <returns></returns>
        public DataSet Login(string Name, string Pwd)
        {
            try
            {
                DataSet ds = db.ExecuteDataSet(CommandType.Text, " select * from Login_User where Login_Name='" + Name + "' and Login_Pwd='" + Pwd + "'");
                return ds;
            }
            catch (Exception)
            {
                
                throw;
            }
            finally
            {

            }
          
        }
    }
}
